package com.paypalpay.service.impl;

import com.paypalpay.entity.common.UnifiedOrderPackages;
import com.paypalpay.mapper.UnifiedOrderPackagesMapper;
import com.paypalpay.service.UnifiedOrderPackagesService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional
public class UnifiedOrderPackagesServiceImpl implements UnifiedOrderPackagesService {
    @Resource
    UnifiedOrderPackagesMapper unifiedOrderPackagesMapper;

    @Override
    public void putInOrderInfo(UnifiedOrderPackages order) {

        unifiedOrderPackagesMapper.putInOrderInfo(order);
    }

    @Override
    public void updateOrderInfo(UnifiedOrderPackages order) {

        unifiedOrderPackagesMapper.updateOrderInfo(order);
    }

    @Override
    public String getIsOpenByOrderIdanddeviceId(String deviceId, String orderId) {
        return unifiedOrderPackagesMapper.getIsOpenByOrderIdanddeviceId(deviceId, orderId);
    }

    @Override
    public void updateIsOpenByorderId(UnifiedOrderPackages user) {
        unifiedOrderPackagesMapper.updateIsOpenByorderId(user);
    }

    //无卡用户下单记录入库
    @Override
    public void putInOrderNoDeviceInfo(UnifiedOrderPackages orders) {
        unifiedOrderPackagesMapper.putInOrderNoDeviceInfo(orders);
    }

    //根据deviceId先去把支付订单orderId等数据的表更新一下
    @Override
    public void updateOrderInfoByDeviceId(UnifiedOrderPackages unifiedOrder) {
        unifiedOrderPackagesMapper.updateOrderInfoByDeviceId(unifiedOrder);
    }
}
